package com.hszl.blog.utils;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;

/**
 * @author: 胡爽
 * @date: 2022/6/6 14:34
 **/
public class HttpContextUtils {

    public static HttpServletRequest getHttpServletRequest(){

        return ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest();
    }
}
